import { Observer, useLocalObservable } from 'mobx-react'
import React from 'react'
import store from './store';

export default function MobxCom() {

    const r_store = useLocalObservable(() => store);

  return (
    <div>
        <Observer>
            {
                () => (
                    <div>
                    <div>{r_store.count}</div>
                    <div>{r_store.info.name}</div>
                    <div>{r_store.double}</div>
                    <button onClick={() => r_store.add_count()}>+</button>
                    </div>
                )
            }
        </Observer>
    </div>
  )
}
